<?php /*a:3:{s:68:"/www/wwwroot/qt.feifeiyu.club/app/admin/view/article/content_add.vue";i:1690862134;s:59:"/www/wwwroot/qt.feifeiyu.club/app/admin/view/index/meta.vue";i:1691032692;s:61:"/www/wwwroot/qt.feifeiyu.club/app/admin/view/index/footer.vue";i:1690447758;}*/ ?>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo get_config('site_name'); ?> - 后台管理</title>
    <link rel="stylesheet" type="text/css" href="/static/css/layui.css" /><link rel="stylesheet" type="text/css" href="/static/css/bootstrap.css" /><link rel="stylesheet" type="text/css" href="/static/css/mian.css" /><script type="text/javascript" src="/static/js/jquery.min.js"></script><script type="text/javascript" src="/static/js/bootstrap.bundle.min.js"></script><script type="text/javascript" src="/static/js/layui.js"></script> <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/c/font_4112823_w668vgmca4.css" />
    </head>
<link rel="stylesheet" type="text/css" href="/static/css/wangeditor.css" />
<div class="el-dialog__body">
 <!--顶部-->
     <form method="post" onsubmit="return post_add(this,'<?php echo url('add'); ?>')">   
  <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">标题</label>
    <div class="col-sm-10">
      <input type="text" name="title" class="form-control" placeholder="请输入标题">
    </div>
  </div>
  
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">选择栏目</label>
    <div class="col-sm-10">
      <select class="form-select" name="catid" aria-label="选择栏目">
          <?php if(is_array($cate) || $cate instanceof \think\Collection || $cate instanceof \think\Paginator): $i = 0; $__LIST__ = $cate;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
          <option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['catname']); ?></option>
          <?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
    </div>
  </div>
  
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">关键词</label>
    <div class="col-sm-10">
      <input type="text" name="keywords" class="form-control" placeholder="请输入关键词">
    </div>
  </div>
  
    
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">描述</label>
    <div class="col-sm-10">
      <textarea type="text" name="description" rows="5" class="form-control" placeholder="请输入描述"></textarea>
    </div>
  </div>
  
    
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">发布时间</label>
    <div class="col-sm-10">
      <input type="text" name="inputtime" id="inputtime" value="<?php echo date('Y-m-d H:i:s'); ?>" class="form-control" placeholder="请输入发布时间">
    </div>
  </div>
  
    
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">阅读权限</label>
    <div class="col-sm-10">
      <select class="form-select" name="groupids_view" aria-label="选择阅读权限">
          <option value="0">无权限</option>
          <?php if(is_array($group) || $group instanceof \think\Collection || $group instanceof \think\Paginator): $i = 0; $__LIST__ = $group;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?> 
          <option value="<?php echo htmlentities($vo['groupid']); ?>"><?php echo htmlentities($vo['name']); ?></option>
          <?php endforeach; endif; else: echo "" ;endif; ?>
        </select>
    </div>
  </div>
  
    
    <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">阅读收费</label>
    <div class="col-sm-10 input-group mb-3" style="width: 83.33333333%;">
      <input type="number" name="readpoint" class="form-control" placeholder="请输入阅读收费">
      
        <div class="form-check form-check-inline" style="margin: auto 1rem;">
  <input class="form-check-input" type="radio" name="paytype" value="1" id="inlineRadio1" checked="">
  <label class="form-check-label" for="inlineRadio1">积分</label>
</div>
<div class="form-check form-check-inline"  style="margin: auto 1rem;">
  <input class="form-check-input" type="radio" name="paytype" value="2" id="inlineRadio2" >
  <label class="form-check-label" for="inlineRadio2">金钱</label>
</div>
        
    </div>
  </div>
  
  
      <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">缩略图</label>
    <div class="col-sm-10 input-group mb-3" style="width: 83.33333333%;">
              <input type="text" id="thumb" name="thumb" class="form-control" placeholder="请输入选择图像">
               <button onclick="qh_open('图片管理','<?php echo url('attachment/add',['name'=>'thumb']); ?>',700,500)" class="el-button el-button--primary" type="button">上传</button>
            </div>
  </div>
  
  
      <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">来源</label>
    <div class="col-sm-10">
      <input type="text" name="copyfrom" class="form-control" placeholder="请输入来源">
    </div>
  </div>
  
  
  
      <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">点击</label>
    <div class="col-sm-10">
      <input type="text" name="click" value="<?php echo rand(10,99); ?>" class="form-control" placeholder="请输入点击">
    </div>
  </div>
  
  
      <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">昵称</label>
    <div class="col-sm-10">
      <input type="text" name="nickname" value="<?php echo htmlentities($admin['nickname']); ?>" class="form-control" placeholder="请输入昵称">
    </div>
  </div>
  
      <div class="mb-3 row">
    <label  class="col-sm-2 col-form-label">内容</label>
    <div class="col-sm-10">
     <div id="editor—wrapper" style="border: var(--bs-border-width) solid var(--bs-border-color);">
     <div id="editor-toolbar" class="editor-toolbar"></div>
    <div id="editor-text-area" class="editor-text-area"></div>
       <textarea type="text" id="editor-content-textarea" name="content" style="display: none;"></textarea>
    </div>
  </div>
  
  <!--底部-->
    <footer class="el-dialog__footer">
        <span class="dialog-footer">
            <button  type="button" class="el-button el-button--danger" data-bs-dismiss="modal" aria-label="Close">
                <span class="">取消</span></button>
            <button class="el-button el-button--primary" aria-disabled="false" type="submit">
                <span class="">确认</span></button>
        </span>
    </footer>
    </form>

</div>
<script>
layui.use(function(){
  var laydate = layui.laydate;
  // 日期时间选择器 - 日期和时间选择器同时显示（全面板）
  laydate.render({
    elem: '#inputtime',
    type: 'datetime',
   });
 });
</script>
<script type="text/javascript" src="/static/js/wangeditor.js"></script> 
<script type="text/javascript">
 window._win = {}
</script>
<script type="text/javascript" src="/static/js/mian.js"></script>
<script>
const E = window.wangEditor

    // Change language
    const LANG = location.href.indexOf('lang=en') > 0 ? 'en' : 'zh-CN'
    E.i18nChangeLanguage(LANG)
    
    const editorConfig = { 
        onChange(editor) {
      const html = editor.getHtml()
       document.getElementById('editor-content-textarea').value = html
    },
        MENU_CONF: {} }
    editorConfig.MENU_CONF['uploadImage'] = {
      server: '<?php echo url('admin/attachment/upload_content'); ?>',
      timeout: 5 * 1000, // 5s
      fieldName: 'file',
      meta: { token: 'xxx', a: 100 },
      metaWithUrl: true, // join params to url
      headers: { Accept: 'text/x-json' },
       maxFileSize: 10 * 1024 * 1024, // 10M
       base64LimitSize: 5 * 1024, // insert base64 format, if file's size less than 5kb
       onBeforeUpload(file) {
        console.log('onBeforeUpload', file)
        return file // will upload this file
        // return false // prevent upload
      },
      onProgress(progress) {
        console.log('onProgress', progress)
      },
      onSuccess(file, res) {
        console.log('onSuccess', file, res)
      },
      onFailed(file, res) {
        alert(res.message)
        console.log('onFailed', file, res)
      },
      onError(file, err, res) {
        alert(err.message)
        console.error('onError', file, err, res)
      },
     

    }

    const editor = E.createEditor({
      selector: '#editor-text-area',
      html: '',
      config: editorConfig
    })

    const toolbar = E.createToolbar({
      editor,
      selector: '#editor-toolbar',
      // config: {}
    })

</script>
<style>
    body{background: #fff;min-width: auto;}
    #editor—wrapper {z-index: 10000000; /* 按需定义 */}#editor-text-area { height: 400px; }
</style>
